<template>
  <div class="charts" ref="charts"></div>
</template>

<script>
// 引入echarts
import echarts from 'echarts'
export default {
  name: 'BarChart',
  mounted() {
    // 挂载时，即初始化echarts实例
    let linechart = echarts.init(this.$refs.charts)
    linechart.setOption({
      xAxis: {
        show: false,
        type: 'category'
      },
      yAxis: {
        show: false
      },
      series: [
        {
          type: 'bar',
          data: [23, 44, 44, 12, 7, 89, 10.11, 45, 67, 15, 76]
        }
      ],
      // tooltip
      tooltip: {},
      // 布局
      grid: {
        left: 0,
        top: 3,
        right: 0,
        bottom: 0
      }
    })
  }
}
</script>

<style>
.charts {
  width: 100%;
  height: 100%;
}
</style>